{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c605fd1b-97b2-4d56-b510-1098f016d18e",
   "metadata": {},
   "source": [
    "Python的数据结构\n",
    "-List\n",
    "-Tuple\n",
    "-dict\n",
    "-Set\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e1b7fced-9916-4ff1-a17e-45ab58c544bc",
   "metadata": {},
   "source": [
    "## List"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d86b5133-3bad-4fcf-b8b2-366d986f5e87",
   "metadata": {},
   "source": [
    "## 中括号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f8f9281a-7b1f-4a08-9ee8-65be91737fe1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    }
   ],
   "source": [
    "#创建列表：\n",
    "a = [1,2,3,4,5,6]\n",
    "#显示第三个元素：\n",
    "print(a[2])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "6543ae0f-5a59-4287-b428-9133425bd530",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 1, 2]\n"
     ]
    }
   ],
   "source": [
    "a = []\n",
    "#在a的最后面增加一个0,一个2\n",
    "a.append(0)\n",
    "a.append(2)\n",
    "#在0和2之间加入一个1：insert(位置，值）\n",
    "a.insert(1,1)\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "858d30bf-0135-4b98-b941-d0749ffb09f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 3, 5]\n"
     ]
    }
   ],
   "source": [
    "b = [1,2,3,4,5]\n",
    "#从b里面把4删除：remove(想删除的值）\n",
    "b.remove(4)\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b36b8176-e4b2-4396-a1fe-b06b790fd4e0",
   "metadata": {},
   "source": [
    "## Tuple"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f78d37cd-2f02-4bc1-84b5-5e235cba9416",
   "metadata": {},
   "source": [
    "## 小括号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "2e207779-126b-4cf3-99d0-dee2d863e4d6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a= (1,2,3,4,5)\n",
    "b = [1,2,3,4,5]\n",
    "#Tuple和list的区别：Tuple 不容易变更（元组不能修改）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e411aa2-151b-4e5c-b99e-6a4c3438f394",
   "metadata": {},
   "source": [
    " ## Dict："
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2ce8deb7-4595-46dd-904d-0fe0f610070b",
   "metadata": {},
   "source": [
    "## 大括号里面要加引号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "e17c8e37-c814-49d6-9cb3-900cf20e2f62",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid character '：' (U+FF1A) (2538001448.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[33], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    planents = {\"地球\"：\"Earth\"， \"}\u001b[0m\n\u001b[1;37m                    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid character '：' (U+FF1A)\n"
     ]
    }
   ],
   "source": [
    "planents = {\"地球\":\"Earth\", \"水星\":\"Mercury\",\"金星\"：\"Venus\": , \"火星\"}\n",
    "print(planents['地球']"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ffe9d566-67f7-484e-95b0-ead2ff9bbe7e",
   "metadata": {},
   "source": [
    " ## Set"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bd1c1b6d-4f84-4293-bbe1-a5cc1c61240f",
   "metadata": {},
   "source": [
    "## 大括号里面没有引号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "039097d5-e5b8-4307-9550-139c989e1679",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{1, 4, 5, 6}\n"
     ]
    }
   ],
   "source": [
    "#set（集合）不支持数据的重复\n",
    "number = {1,1,1,4,5,6,}\n",
    "print(number)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "59e70543-414b-4996-b490-1282fdc6299c",
   "metadata": {},
   "outputs": [],
   "source": [
    ",Python程序的执行流程和基本语句：\n",
    "顺序执行\n",
    "\n",
    "条件判断：if ，else\n",
    "\n",
    "循环语句：for ，while，continue, \n",
    ","
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f75a1568-62f5-4b28-a230-ac837cb579eb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "a639a9c5-e082-40a0-9c48-3af3bc4d565d",
   "metadata": {},
   "source": [
    "##计算机程序如何执行：\n",
    "程序是按顺序执行的"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "523d6e48-685d-4042-ba1a-668d3d56efbf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    }
   ],
   "source": [
    "a = 1\n",
    "b = 2\n",
    "c = a + b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3fac9a3f-a2db-43d0-bc23-75e39efc71d1",
   "metadata": {},
   "outputs": [],
   "source": [
    "a,b =b,a  #a b两者的值做交换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2a52d912-0a41-494d-9adf-9864c3d5fd3d",
   "metadata": {},
   "outputs": [],
   "source": [
    " t = a \n",
    " a = b  \n",
    " b = t  #增加一个临时变量t也可以交换ab的值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "777caf98-8880-4bed-b0ee-ab683e57f33b",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = a + b\n",
    "b = a - b\n",
    "a = a - b\n",
    "#这样写ab也可以互换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b0c76fe3-e059-434e-ab1b-6f0a634666b5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n"
     ]
    }
   ],
   "source": [
    "for i in range(5):#让i在0-5之内变化\n",
    "    print(i)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "27cf01f4-2ce7-483b-8fa7-e0059e2d0b64",
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyturtle as t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "f7559dc9-0686-436f-b4bd-b269c0d40d98",
   "metadata": {},
   "outputs": [],
   "source": [
    "t.forward(50)#向前走50\n",
    "t.left(90)#向左转90度\n",
    "t.forward(50)#向前走50\n",
    "t.left(90)#向左转90度\n",
    "t.forward(50)#向前走50\n",
    "t.left(90)#向左转90度\n",
    "t.forward(50)#向前走50\n",
    "t.left(90)#向左转90度\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "a19b51c2-a149-4ae8-a47d-98820c447172",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 160,75 210,75 210,25 160,25 160,75 210,75 210,25 160,25 160,75 210,75 210,25 160,25 160,75 210,75 210,25 160,25 160,75 210,75 201.3,25.8 152.1,34.4 160.8,83.7 210,75 192.9,28 145.9,45.1 163,92.1 210,75 185,31.7 141.7,56.7 166.7,100 210,75 177.9,36.7 139.6,68.8 171.7,107.1 210,75 171.7,42.9 139.6,81.2 177.9,113.3 210,75 166.7,50 141.7,93.3 185,118.3 210,75 163,57.9 145.9,104.9 192.9,122 210,75 160.8,66.3 152.1,115.6 201.3,124.2 210,75 160,75 160,125 160,175 210,175 210,125 160,125 168.7,174.2 217.9,165.6 209.2,116.3 160,125 177.1,172 224.1,154.9 207,107.9 160,125 185,168.3 228.3,143.3 203.3,100 160,125 192.1,163.3 230.4,131.2 198.3,92.9 160,125 198.3,157.1 230.4,118.8 192.1,86.7 160,125 127.9,163.3 166.2,195.4 198.3,157.1 160,125 135,168.3 178.3,193.3 203.3,150 160,125 142.9,172 189.9,189.1 207,142.1 160,125 151.3,174.2 200.6,182.9 209.2,133.7 160,125 160,175 210,175 210,125 160,125 168.7,174.2 217.9,165.6 209.2,116.3 160,125 177.1,172 224.1,154.9 207,107.9 160,125 185,168.3 228.3,143.3 203.3,100 160,125 192.1,163.3 230.4,131.2 198.3,92.9 160,125 198.3,157.1 230.4,118.8 192.1,86.7 160,125 203.3,150 228.3,106.7 185,81.7 160,125 207,142.1 224.1,95.1 177.1,78 160,125 209.2,133.7 217.9,84.4 168.7,75.8 160,125 210,125 210,75 160,75 160,125 209.2,116.3 200.6,67.1 151.3,75.8 160,125 207,107.9 189.9,60.9 142.9,78 160,125 203.3,100 178.3,56.7 135,81.7 160,125 198.3,92.9 166.2,54.6 127.9,86.7 160,125 192.1,86.7 153.8,54.6 121.7,92.9 160,125 185,81.7 141.7,56.7 116.7,100 160,125 177.1,78 130.1,60.9 113,107.9 160,125 168.7,75.8 119.4,67.1 110.8,116.3 160,125 160,75 110,75 110,125 160,125 151.3,75.8 102.1,84.4 110.8,133.7 160,125 142.9,78 95.9,95.1 113,142.1 160,125 135,81.7 91.7,106.7 116.7,150 160,125 127.9,86.7 89.6,118.8 121.7,157.1 160,125 121.7,92.9 89.6,131.2 127.9,163.3 160,125 116.7,100 91.7,143.3 135,168.3 160,125 113,107.9 95.9,154.9 142.9,172 160,125 110.8,116.3 102.1,165.6 151.3,174.2 160,125 110,125 110,175 160,175 160,125 110.8,133.7 119.4,182.9 168.7,174.2 160,125 113,142.1 130.1,189.1 177.1,172 160,125 116.7,150 141.7,193.3 185,168.3 160,125 121.7,157.1 153.8,195.4 192.1,163.3 160,125 127.9,163.3 166.2,195.4 198.3,157.1 160,125 135,168.3 178.3,193.3 203.3,150 160,125 142.9,172 189.9,189.1 207,142.1 160,125 151.3,174.2 200.6,182.9 209.2,133.7 160,125 160,175 210,175 210,125 160,125 168.7,174.2 217.9,165.6 209.2,116.3 160,125 177.1,172 224.1,154.9 207,107.9 160,125 185,168.3 228.3,143.3 203.3,100 160,125 192.1,163.3 230.4,131.2 198.3,92.9 160,125 198.3,157.1 230.4,118.8 192.1,86.7 160,125 203.3,150 228.3,106.7 185,81.7 160,125 207,142.1 224.1,95.1 177.1,78 160,125 209.2,133.7 217.9,84.4 168.7,75.8 160,125 210,125 210,75 160,75 160,125 209.2,116.3 200.6,67.1 151.3,75.8 160,125 207,107.9 189.9,60.9 142.9,78 160,125 203.3,100 178.3,56.7 135,81.7 160,125 198.3,92.9 166.2,54.6 127.9,86.7 160,125 192.1,86.7 153.8,54.6 121.7,92.9 160,125 185,81.7 141.7,56.7 116.7,100 160,125 177.1,78 130.1,60.9 113,107.9 160,125 168.7,75.8 119.4,67.1 110.8,116.3 160,125 160,75 110,75 110,125 160,125 151.3,75.8 102.1,84.4 110.8,133.7 160,125 142.9,78 95.9,95.1 113,142.1 160,125 135,81.7 91.7,106.7 116.7,150 160,125 127.9,86.7 89.6,118.8 121.7,157.1 160,125 121.7,92.9 89.6,131.2 127.9,163.3 160,125 116.7,100 91.7,143.3 135,168.3 160,125 113,107.9 95.9,154.9 142.9,172 160,125 110.8,116.3 102.1,165.6 151.3,174.2 160,125 110,125 110,175 160,175 160,125 110.8,133.7 119.4,182.9 168.7,174.2 160,125 113,142.1 130.1,189.1 177.1,172 160,125 116.7,150 141.7,193.3 185,168.3 160,125 121.7,157.1 153.8,195.4 192.1,163.3 160,125 127.9,163.3 166.2,195.4 198.3,157.1 160,125 135,168.3 178.3,193.3 203.3,150 160,125 142.9,172 189.9,189.1 207,142.1 160,125\" />'\n",
       "\n",
       "<g transform=\"rotate(110.0,160.0,125.0) translate(160.0, 125.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "t.forward(10)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "58f2807e-40a5-411f-a54e-dd3ba4b067b2",
   "metadata": {},
   "outputs": [],
   "source": [
    "#同样的效果：\n",
    "import jupyturtle as t\n",
    "for i in range(4):  #以下程序进行四次循环\n",
    "    t.forward(50)\n",
    "    t.left(90)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d83bc5b2-06bd-4b9e-a36a-ea128d22bfa8",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "for j in range(36):\n",
    "    for i in range(4):  #以下程序进行四次循环\n",
    "        t.forward(50)\n",
    "        t.left(90)\n",
    "    t.left(10)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9739e971-fb66-405e-98f2-df2ba6169061",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 151,75 152,75 153,74.9 154,74.9 155,74.8 156,74.7 157,74.6 158,74.5 159,74.4 160,74.2 160.9,74 161.9,73.9 162.9,73.6 163.9,73.4 164.8,73.2 165.8,72.9 166.8,72.6 167.7,72.4 168.7,72 169.6,71.7 170.6,71.4 171.5,71 172.4,70.6 173.3,70.3 174.3,69.8 175.2,69.4 176.1,69 177,68.5 177.8,68.1 178.7,67.6 179.6,67.1 180.4,66.6 181.3,66 182.1,65.5 183,64.9 183.8,64.4 184.6,63.8 185.4,63.2 186.2,62.5 186.9,61.9 187.7,61.3 188.5,60.6 189.2,59.9 189.9,59.3 190.7,58.6 191.4,57.9 192.1,57.1 192.7,56.4 193.4,55.7 194.1,54.9 194.7,54.2 195.3,53.4 196,52.6 196.6,51.8 197.1,51 197.7,50.2 198.3,49.3 198.8,48.5 199.4,47.6 199.9,46.8 200.4,45.9 200.9,45 201.3,44.2 201.8,43.3 202.2,42.4 202.6,41.5 203,40.6 203.4,39.6 203.8,38.7 204.2,37.8 204.5,36.8 204.8,35.9 205.1,34.9 205.4,34 205.7,33 206,32.1 206.2,31.1 206.4,30.1 206.6,29.1 206.8,28.1 207,27.2 207.2,26.2 207.3,25.2 207.4,24.2 207.5,23.2 207.6,22.2 207.7,21.2 207.7,20.2 207.8,19.2 207.8,18.2 207.8,17.2 207.8,16.2 207.7,15.2 207.7,14.2 207.6,13.2 207.5,12.2 207.4,11.2 207.3,10.2 207.2,9.2 207,8.2 206.8,7.3 206.6,6.3 206.4,5.3 206.2,4.3 206,3.4 205.7,2.4 205.4,1.4 205.1,0.5 204.8,-0.5 204.5,-1.4 204.2,-2.4 203.8,-3.3 203.4,-4.2 203,-5.1 202.6,-6.1 202.2,-7 201.8,-7.9 201.3,-8.8 200.9,-9.6 200.4,-10.5 199.9,-11.4 199.4,-12.2 198.8,-13.1 198.3,-13.9 197.7,-14.7 197.1,-15.6 196.6,-16.4 196,-17.2 195.3,-18 194.7,-18.7 194.1,-19.5 193.4,-20.3 192.7,-21 192.1,-21.7 191.4,-22.5 190.7,-23.2 189.9,-23.9 189.2,-24.5 188.5,-25.2 187.7,-25.9 186.9,-26.5 186.2,-27.1 185.4,-27.8 184.6,-28.4 183.8,-28.9 183,-29.5 182.1,-30.1 181.3,-30.6 180.4,-31.1 179.6,-31.7 178.7,-32.2 177.8,-32.6 177,-33.1 176.1,-33.6 175.2,-34 174.3,-34.4 173.3,-34.8 172.4,-35.2 171.5,-35.6 170.6,-36 169.6,-36.3 168.7,-36.6 167.7,-36.9 166.8,-37.2 165.8,-37.5 164.8,-37.8 163.9,-38 162.9,-38.2 161.9,-38.4 160.9,-38.6 160,-38.8 159,-39 158,-39.1 157,-39.2 156,-39.3 155,-39.4 154,-39.5 153,-39.5 152,-39.6 151,-39.6 150,-39.6 149,-39.6 148,-39.5 147,-39.5 146,-39.4 145,-39.3 144,-39.2\" />'\n",
       "\n",
       "<g transform=\"rotate(83.0,144.0,-39.2) translate(144.0, -39.2)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(360):\n",
    "    t.forward(1)\n",
    "    t.left(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8f01ac1b-fbd3-43ea-b7b7-54f8c08443f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 200,75 215.5,27.4 175,-1.9 134.5,27.4 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(5):\n",
    "    t.forward(50)\n",
    "    t.left(72)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "e658e9b6-7c42-4b24-a5c6-9d3455300510",
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(5):\n",
    "    t.forward(50)\n",
    "    t.right(144)\n",
    "t.right(36)\n",
    "for i in range(5):\n",
    "    t.forward(30.9)\n",
    "    t.left(72)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d4d16560-612b-40e6-b895-9518da4c9c20",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 200,75 150,75 175,118.3 150,75 125,118.3 150,75 100,75 150,75 125,31.7 150,75 175,31.7 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(6):\n",
    "    t.forward(50)\n",
    "    t.left(180)\n",
    "    t.forward(50)\n",
    "    t.left(120)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0005602c-e28e-4bcf-8368-effdbb85db9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 230,75 173.4,18.4 173.4,98.4 230,41.9 150,41.9 206.6,98.4 206.6,18.4 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(8):\n",
    "    t.forward(80)\n",
    "    t.left(180-360/8)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "927c3d9e-1a33-4728-9ef7-6031854c2949",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,75 250,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 250,75 250,-25\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 250,-25 150,-25\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 150,-25 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "t.set_color('red')#设置颜色\n",
    "t.forward(100)\n",
    "t.left(90)\n",
    "t.set_color('blue')#设置颜色\n",
    "t.forward(100)\n",
    "t.left(90)\n",
    "t.set_color('yellow')#设置颜色\n",
    "t.forward(100)\n",
    "t.left(90)\n",
    "t.set_color('green')#设置颜色\n",
    "t.forward(100)\n",
    "t.left(90)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e5aea3a3-b935-46a2-88b2-69e9ad293cfb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,75 180,75 180,45 150,45 150,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 150,75 190,75 190,35 150,35 150,75\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 150,75 200,75 200,25 150,25 150,75\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 150,75 210,75 210,15 150,15 150,75\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150,75 220,75 220,5 150,5 150,75\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 150,75 230,75 230,-5 150,-5 150,75\" />'\n",
       "\n",
       "<path stroke=\"brown\" stroke-width=\"2\" d=\"M 150,75 240,75 240,-15 150,-15 150,75\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,75 170,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 170,75 170,55\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 170,55 150,55\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 150,55 150,75\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150,75 180,75\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 180,75 180,45\" />'\n",
       "\n",
       "<path stroke=\"brown\" stroke-width=\"2\" d=\"M 180,45 150,45\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,45 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(0.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "a = 20\n",
    "colors= ['red', 'blue' ,'yellow' , 'green' , 'pink' , 'black' ,'brown']\n",
    "for j in range(7):\n",
    "    \n",
    "    t.set_color(colors[j])\n",
    "    a +=10\n",
    "    for i in range(4):\n",
    "        t.forward(a)\n",
    "        t.left(90)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d1e646fd-4798-4e9e-b95e-4601edc218f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,75 170,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 170,75 170,55\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 170,55 150,55\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 150,55 150,75\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150,75 180,75\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 180,75 180,45\" />'\n",
       "\n",
       "<path stroke=\"brown\" stroke-width=\"2\" d=\"M 180,45 150,45\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,45 150,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 150,75 190,75\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 190,75 190,35\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 190,35 150,35\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150,35 150,75\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 150,75 200,75\" />'\n",
       "\n",
       "<path stroke=\"brown\" stroke-width=\"2\" d=\"M 200,75 200,25\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 200,25 150,25\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 150,25 150,75\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 150,75 210,75\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 210,75 210,15\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 210,15 150,15\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 150,15 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "import jupyturtle as t\n",
    "t.set_default(TURTLE_DELAY=0)\n",
    "a = 20\n",
    "colors= ['red', 'blue' ,'yellow' , 'green' , 'pink' , 'black' ,'brown']\n",
    "count = 0\n",
    "for j in range(5):\n",
    "    for i in range(4):\n",
    "        t.set_color(colors[(count)%7])\n",
    "        t.forward(20 + 10*j)\n",
    "        t.left(90)\n",
    "        count += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff4414b1-7915-4355-8abd-61a714c213ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyturtle as t\n",
    "t.set_default(TURTLE_DELAY=0)\n",
    "a = 20\n",
    "colors= ['red', 'blue' ,'yellow' , 'green' , 'pink' , 'black' ,'brown']\n",
    "count = 0\n",
    "\n",
    "for j in range(5):\n",
    "    for i in range(4):\n",
    "        t.set_color(colors[(count)%7])\n",
    "        t.forward(20 + 10*j)\n",
    "        t.left(90)\n",
    "        count += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "56d56153-639c-40a3-affa-337f00ebfd51",
   "metadata": {},
   "outputs": [],
   "source": [
    "import jupyturtle as t\n",
    "colors= ['red', 'blue' ,'yellow' , 'green' , 'pink' , 'black' ,'brown']\n",
    "for a in range(5):\n",
    "    \n",
    "    for i in range(6):\n",
    "        t.forward(5 + a)\n",
    "        t.left(60)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ce46c59f-02da-4ef8-a334-aa0eb16b92e2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"#663399\" stroke-width=\"2\" d=\"M 150,75 230,75 153.9,50.3 218.6,97.3 171.6,32.6 196.3,108.7 196.3,28.7 171.6,104.7 218.6,40 153.9,87.1 230,62.3 150,62.3 226.1,87.1 161.4,40 208.4,104.7 183.7,28.7 183.7,108.7 208.4,32.6 161.4,97.3 226.1,50.3 150,75\" />'\n",
       "\n",
       "<g transform=\"rotate(-90.0,150.0,75.0) translate(150.0, 75.0)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "for i in range(20):\n",
    "    t.forward(80)\n",
    "    t.left(180-360/20)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "115311be-306c-4572-a9b3-9c0e1606e9c7",
   "metadata": {},
   "source": [
    "作业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aaf3bbe1-fc94-4451-9b41-6d23f16b1c8b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<svg width=\"300\" height=\"150\" style=\"fill:none; stroke-linecap:round;\">\n",
       "    <rect width=\"100%\" height=\"100%\" fill=\"#F3F3F7\" />\n",
       "\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 150,75 155,75\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 155,75 158.2,69.9\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 158.2,69.9 155.1,63.6\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 155.1,63.6 147.2,62.8\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 147.2,62.8 141.6,69.9\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 141.6,69.9 145,79.3\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 145,79.3 155.8,81.6\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 155.8,81.6 164.1,72.9\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 164.1,72.9 161,60.3\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 161,60.3 147.7,56\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 147.7,56 136.2,65.6\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 136.2,65.6 138.4,81.5\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 138.4,81.5 153.9,88.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 153.9,88.4 168.9,78.3\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 168.9,78.3 168.2,59.3\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 168.2,59.3 150.9,49.3\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150.9,49.3 132.3,59.2\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 132.3,59.2 130.8,81.1\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 130.8,81.1 149.4,94.7\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 149.4,94.7 171.7,85.7\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 171.7,85.7 176,61\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 176,61 156.7,43.7\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 156.7,43.7 130.7,51.1\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 130.7,51.1 123,78\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 123,78 142.4,99.6\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 142.4,99.6 172,94.4\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 172,94.4 183.6,65.6\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 183.6,65.6 164.8,39.7\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 164.8,39.7 131.8,42\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 131.8,42 115.9,72\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 115.9,72 133.4,102.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 133.4,102.4 169.4,103.6\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 169.4,103.6 190,72.9\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 190,72.9 174.6,38.2\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 174.6,38.2 136,32.8\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 136,32.8 110.3,63.4\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 110.3,63.4 122.9,102.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 122.9,102.4 163.7,112.6\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 163.7,112.6 194.6,82.7\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 194.6,82.7 185.5,39.7\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 185.5,39.7 143.2,24.3\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 143.2,24.3 106.9,52.6\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 106.9,52.6 111.8,99.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 111.8,99.4 155,120.4\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 155,120.4 196.5,94.4\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 196.5,94.4 196.5,44.4\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 196.5,44.4 153.3,17.4\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 153.3,17.4 106.5,40.2\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 106.5,40.2 101,92.9\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 101,92.9 143.6,126.2\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 143.6,126.2 195.2,107.3\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 195.2,107.3 206.9,52.6\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 206.9,52.6 165.9,13\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 165.9,13 109.6,27\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 109.6,27 91.4,83.1\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 91.4,83.1 129.9,129.1\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 129.9,129.1 190.4,120.6\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 190.4,120.6 215.6,63.9\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 215.6,63.9 180.3,11.7\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 180.3,11.7 116.4,13.9\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 116.4,13.9 83.9,70.2\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 83.9,70.2 114.9,128.5\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 114.9,128.5 181.7,133.2\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 181.7,133.2 221.7,78.2\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 221.7,78.2 195.8,14.2\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 195.8,14.2 126.9,2\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 126.9,2 79.4,54.8\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 79.4,54.8 99.2,124\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 99.2,124 169.4,144.1\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 169.4,144.1 224.4,94.6\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 224.4,94.6 211.4,20.8\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 211.4,20.8 140.9,-7.7\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 140.9,-7.7 78.6,37.6\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 78.6,37.6 84,115.4\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 84,115.4 153.8,152.5\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 153.8,152.5 223.1,112.5\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 223.1,112.5 225.9,31.5\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 225.9,31.5 157.9,-14.4\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 157.9,-14.4 82.1,19.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 82.1,19.4 70.4,102.6\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 70.4,102.6 135.5,157.2\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 135.5,157.2 217.3,130.7\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 217.3,130.7 238.4,46.2\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 238.4,46.2 177.2,-17.1\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 177.2,-17.1 90.2,1.4\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 90.2,1.4 59.4,86\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 59.4,86 115.4,157.7\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 115.4,157.7 206.9,148.1\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 206.9,148.1 247.7,64.5\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 247.7,64.5 197.9,-15.2\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 197.9,-15.2 102.9,-15.2\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 102.9,-15.2 52,66.2\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 52,66.2 94.5,153.4\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 94.5,153.4 192,163.6\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 192,163.6 252.9,85.6\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 252.9,85.6 218.7,-8.3\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 218.7,-8.3 119.9,-29.3\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 119.9,-29.3 49.1,44\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 49.1,44 74,144\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 74,144 172.9,176.1\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 172.9,176.1 253.3,108.6\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 253.3,108.6 238.6,3.6\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 238.6,3.6 140.8,-39.9\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 140.8,-39.9 51.3,20.5\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 51.3,20.5 55.1,129.5\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 55.1,129.5 150.4,184.5\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 150.4,184.5 248.4,132.3\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 248.4,132.3 256.2,20.6\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 256.2,20.6 164.8,-45.8\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 164.8,-45.8 59.1,-3.1\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 59.1,-3.1 39.1,110.2\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 39.1,110.2 125.3,187.8\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 125.3,187.8 237.8,155.5\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 237.8,155.5 270.3,42.1\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 270.3,42.1 190.7,-46.3\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 190.7,-46.3 72.5,-25.5\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 72.5,-25.5 27.2,86.7\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 27.2,86.7 98.9,185.4\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 98.9,185.4 221.6,176.8\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 221.6,176.8 279.8,67.3\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 279.8,67.3 217.3,-40.9\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 217.3,-40.9 91.4,-45.3\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 91.4,-45.3 20.4,60\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 20.4,60 72.4,176.9\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 72.4,176.9 200.2,194.8\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 200.2,194.8 283.7,95.3\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 283.7,95.3 243.2,-29.3\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 243.2,-29.3 115.2,-61.3\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 115.2,-61.3 19.5,31.1\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 19.5,31.1 47.4,162.2\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 47.4,162.2 174.2,208.4\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 174.2,208.4 281.4,124.6\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 281.4,124.6 267.1,-11.6\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 267.1,-11.6 143,-72.1\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 143,-72.1 25.2,1.6\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 25.2,1.6 25.2,141.6\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 25.2,141.6 144.7,216.3\" />'\n",
       "\n",
       "<path stroke=\"black\" stroke-width=\"2\" d=\"M 144.7,216.3 272.4,154\" />'\n",
       "\n",
       "<path stroke=\"red\" stroke-width=\"2\" d=\"M 272.4,154 287.3,11.8\" />'\n",
       "\n",
       "<path stroke=\"blue\" stroke-width=\"2\" d=\"M 287.3,11.8 173.8,-76.8\" />'\n",
       "\n",
       "<path stroke=\"yellow\" stroke-width=\"2\" d=\"M 173.8,-76.8 37.6,-27.3\" />'\n",
       "\n",
       "<path stroke=\"green\" stroke-width=\"2\" d=\"M 37.6,-27.3 7.2,115.6\" />'\n",
       "\n",
       "<path stroke=\"pink\" stroke-width=\"2\" d=\"M 7.2,115.6 113,217.7\" />'\n",
       "\n",
       "<g transform=\"rotate(-46.0,113.0,217.7) translate(113.0, 217.7)\">\n",
       "    <circle stroke=\"#63A375\" stroke-width=\"2\" fill=\"transparent\" r=\"5.5\" cx=\"0\" cy=\"0\"/>\n",
       "    <polygon points=\"0,12 2,9 -2,9\" style=\"fill:#63A375;stroke:#63A375;stroke-width:2\"/>\n",
       "</g>\n",
       "\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import jupyturtle as t\n",
    "colors= ['red', 'blue' ,'yellow' , 'green' , 'pink' , 'black' ,'brown']\n",
    "for a in range(5):\n",
    "    \n",
    "    for i in range(1000):\n",
    "        t.set_color(colors[(i)%6])\n",
    "        t.forward(5 + i)\n",
    "        t.left(58)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3fb093b1-303a-4ea7-919c-2c025a1cbbfb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6d50535b-1fe1-4ea6-a595-82ddb3709fb2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
